#ifndef PERLIN_HH
# define PERLIN_HH

# include "map.hh"

# include <cstdlib>
# include <ctime>
# include <vector>

class PerlinNoise
{
public:
  PerlinNoise (int size, int seed = 0);
  ~PerlinNoise ();

  // perform the perlin algorithm
  Map* perform (double pers, int nb_oct);
protected:

  // tools for perlin calculation
  int pow (int x, int i);
  double powf (double x, int i);
  double val_interpo (int x, int y, int f, Map* img);
  int interpolate (int y1, int y2, int n, int delta);
  void smooth (Map* map);

  Map* img_;
  std::vector<Map*> vect_;
  std::vector<double> pers_;
};

#endif // !PERLIN_HH
